from machine import Pin
from machine import FPIOA
import time

# 实例化FPIOA
fpioa = FPIOA()

# 设置Pinx为GPIOx
fpioa.set_function(6, FPIOA.GPIO6)
fpioa.set_function(42, FPIOA.GPIO42)

LED1 = Pin(6, Pin.OUT) #构建LED对象
LED2 = Pin(42, Pin.OUT) #构建LED对象

def led_control(x):
    if (x & 1) == 0:
        LED1.off()
    elif (x & 1) == 1:
        LED1.on()
    if (x & 2) == 0:
        LED2.off()
    elif (x & 2) == 2:
        LED2.on()

# while True:
#     for i in range(4):
#         led_control(i)
#         time.sleep_ms(500)
